==============================
 GROEN V4 (3rd December 2012)
==============================

Additions/Fixes
===============

* Added Main Map editor (access by menu: Tools/Main Map Editor)
* Added Area Editor (allows changing a couple of Area-specific variables. access by menu: Tools/Area Editor.)
* Added Tile editor in Tile allocation mode.
* Heavily improved "Data management" mode. The functionality of it is complete (for the data types featured), and it has been tested a good deal.
* Added an editor in Miscellaneous mode for changing items in Neutral Area chambers (including Flare Bomb, Machine Gun, communicators Beta, Gamma and Delta.) 
* Added a Menu, along with some new file functions ("Open ROM", "Revert" and "Save As".)
* Changed the base GUI, removed the "Room Selector" / "SAVE" buttons and placed those features in the menu instead.
* Made it so the Map Layout editing mode synchronize Rooms which use the same Pointer, Height and Width. This way, when a Room's Width or Height is
  changed, the Rooms that shares pointer (BG graphics look identical) becomes synchronized to the changes. (This should remove frustrations with using
  those functions for certain Rooms, which would pretty much make every Room that shared its pointer, un-editable/corrupt).
  The synchronized Room Ids (if any) are displayed in a Edit control in the Map Layout GUI.
* Fixed a bug with pointer table handling, which would (among other possible things) cause pointers to become wrong/off when increasing
  Room Height in Map Layout mode. (in other words, a Room besides the one you incresed Height for would become corrupted in earlier versions.)
* Enhanced the Map editing mode GUI.
	* Changed the selection grid functionality and looks.
	* Made new bitmaps for "Physics" properties selector.
	* Added a graphical representation of the Tile32 blocks generated, which is updated as you edit the map. If there isn't enough space to
	  generate Tile32 blocks for the whole map, the display is shaded in red.
	* Added a list showing the Room Ids that shares Tile32 data with the current Room.
	* The editor displays a status message (under "Editing status:") when Tile32 block limit (146) has been exceeded.
	* Added an option to show sprite of Rad below mouse when you press Shift. Only his "aim bionic arm diagonally" sprite is programmed in though.
* Transformed the editor's setup of hard-coded data, and list text files in the base folder, to a new module system where it loads all
  those things from a YAML file + the text files, from a chosen folder in the "modules" subfolder of the editor.
  This gives hackers the means to change the ROM offsets that the editor uses, and other kinds of datas.
* Added a auto-scrolling function in Unit placement mode for when a Unit is being moved, where it scrolls when you move the mousepointer to or
  outside the border of the Room display.
* Changed Unit moving with mouse so that the relative difference between the point of button-click and the unit's coordinates are taken into
  account when units are moved.
* Reprogrammed Room Selector to not cause memory usage spikes when the room previews are drawn.
* For the sprites that have NES sprite simulation, fixed the addresses for those for the Top Secret module, so sprites don't look corrupted anymore
  for the Japanese ROM.
* Finished Room Id name list, and improved Unit Id name list.
* Various bug-fixes.
* Various corruption-prevention / safety mechanisms implemented. For example, Room Ids with "00" as Height and Width values
  can't be used in Map Layout / Map editing modes (without fixing them in Data Management). Also, when the Map Layout data refers to screen indexes
  past the allocation list size, the Map editing mode will show them as faded and you won't be able to (accidently or not) edit those screens.

Introduction
============

Groen supports both Bionic Commando and the Japanese version, "Top Secret - Hitler no Fukkatsu". (Read on for an explanation of
how to use Groen with the latter).

Groen now uses a sort of module system, where each module has its own folder (found in "modules" folder), each with a .YAML file containing ROM
offsets / maximum values / other datas used, and a number of text files with Id name lists.

In the base folder, the file "module.cfg" determines which module folder to read those files from when the editor launches.

In order to use Groen with the Japanese ROM, do the following:

1. Find the file named "module.cfg" in the base folder.
2. Open it in Notepad or similar plain text editor.
3. Change the single string there from "bionicc" to "topsecret".
4. Save.

Note that support for Top Secret isn't 100%. The "Area Editor" and "Main Map Editor" don't have support for it at all, since none of the ROM addresses
they use have been fixed for Top Secret. The ROM addresses are read from the "data.yaml" file in the "topsecret" module folder, so it would be possible to fix
the addresses and so on for those datas, through that.

If you like, you can create your own module folders, and edit module.cfg to refer to it. Technically, the only requirement for a module folder
is that it contains data.yaml. (if it doesn't find the .txt files it will simply fill the lists with "???" instead.)
The YAML file must contains all the elements that those for "bionicc" or "topsecret" does.

Completion status of Modes/Editors
==================================

Room editing modes:

	Map Allocation: Finished.
	Map Structure: Finished.
	Map Editing: Finished.
	Door placement: Finished.
	Unit placement: GUI is complete. Unit list, VRAM list, and sprite address database needs to be completed.
	Tile allocation: Finished, GUI improvements could be done.
	Palette: Finished.
	Miscellaneous: Event data (continuous unit generating data) editing is missing.
	Data management: Complete, for the types of data you can change. For an improvement, more data types could be added.

Tools menu editors:

	Area Editor: Probably complete.
	Main Map Editor: Finished, but editing of Palette and *hidden paths* would improve it.

Technical notes
===============

Total number of available Tile32 blocks for each set
----------------------------------------------------

The original game never uses more than 128
of these blocks/tiles for each set. (for each chunk of data on $400 bytes.)
Still, there is space for a total of 146 for each set, and the game engine
theoretically supports indexing of up to 256 total. The unused space in the sets
is random data that is never used. So the editor allows you to use 146,
which should make editing maps easier.

Tile32 sets are sometimes shared and pointed to by multiple Room Ids,
some rooms use few blocks and making multiple Rooms use the same set, saves space.
In those cases, the editor keeps the blocks used by those Rooms intact as you
edit the current Room in Map editing mode. You might have less (or much less)
Tile32 blocks available to edit the map.

Questions (that are answered here so they don't need to be asked)
=================================================================

Q: The ROM isn't saved or changed at all when i click File > Save.

A: Your ROM might be read-only. (This is typical of roms from ROM sites). The editor won't give any indication of this. To fix that, find the ROM file
in Windows Explorer, right click it, click Properties, in that dialog you will find the check-box for the ROM being Read-only or not.

Q: How much free space is initially available to insert loaded screens in Map Allocation?

A: Quite much. There is a big segment of unused data after the used data in an original ROM.

Q: How many unused screens are there initially (to use in Map Allocation)?

A: Quite a few. They are found in-between all the used ones. I haven't counted them.

Q: How much free space is there to expand the Height and Width of a Room?

A: None, you will have to shrink the size of other rooms first. Approximately, you have to remove as many screens from a different Room
as the number of screens you want to add. (A collumn of screens uses as many bytes as the actual screens in the col., but a row of screens
actually use 2 more bytes for each row than the screens in it.)

Q: Map tab: Why can't i edit the map / why can't i edit parts of the map?

A: That is because those screens are Screen 0 of the allocated screens for the room. In an original ROM, it is always address $8600 which is
a blank screen. Its protected because this blank screen is re-used for blank parts of the map in many rooms. Use the Map Allocation and
Map Structure modes to change how the map is loaded and arranged.
Also, if the screen is grayed out, it means that screen has a index (in Map Layout data) which is past the number of allocated screens
(in Map Allocation data). You need to fix the map through those two other modes first, in this case also.

Q: Map editing mode: Does the "Convert and Write Map to ROM" button save changes to the ROM file?
Q: Map editing mode: If you answer Yes to "Convert and Write 16x16 Map Data to ROM first?", does it save changes to the ROM file?

A: In both cases No, you have to do Save from the File menu to really save changes to the ROM file. If you do the things above it will write to
the memory of the ROM kept by the program. If you don't press the button, and then answer No to the dialog box when you go to another mode or change
Room, it will discard the changes done and the Room will be as before you edited it in Map editing mode. 

Q: Rooms look the same / palettes look the same / data look the same. If you change one, will it affect another Room that looks equal?

A: Yes, most of the time. For most kinds of datas, you can use the Data Management mode to "Allocate unique data" for the Room. You can also copy another
Room's data by using the "Clone data of Room(B)" buttons in Data Management mode.

Q: Are there unused / beta screens in the game?

A: There are screens in the game which are not used by anything and which does seem to have been genuine screen data. But, they don't appear as
anything but a mess even if placed in ANY of the rooms. I have tested some of them, but not all. There is only one unused screen i found that fits
somewhere, which is the one with address 8940 (index 0xD). When placed in any of the boss rooms, it appears as a screen which fits in the "middle"
of the boss room. This would suggest that sometime in the development, the boss rooms were 3 screens wide instead of 2, or had a different design.

Q: Is there other unused data in the game?

A: Yes. There is a couple unused palette sets. There is also at least one unused set of "tile loading" data. These datas are not pointed to from
any Room, but exist in-between all the other data.

Source / License
================

The program is written in Visual C++ 6.0, using MFC. Some parts were written in x86 Assembly.

The editor uses the LibYAML C library.
The LibYAML library is Copyright (c) 2006 Kirill Simonov.

License for LibYAML:

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Contact
=======

author: Matrixz
AIM: Matrixz127
email: ingegjoestoel@hotmail.com (I would love to hear about hacks made with the editor.)

At the time of writing, i don't plan to update this editor in the future, and will focus on other projects.
If there grows any significant activity in the Romhacking realm about Bionic Commando / Top Secret hacking,
that might inspire me to improve this at some point.